/**
 * 
 */
package com.sxds.wn.service.biz;

import java.util.List;

import com.sxds.wn.bo.CateringTaxationBo;
import com.sxds.wn.bo.TaxpayerInfoBo;
import com.sxds.wn.dao.biz.CateringTaxationDao;
import com.sxds.wn.dao.biz.CodeDao;
import com.sxds.wn.exception.DataAccessException;
import com.sxds.wn.exception.ParameterException;
import com.sxds.wn.service.BaseService;
import com.sxds.wn.service.IService;
import com.sxds.wn.util.DateUtil;

/**
 * @author ibm
 *
 */
public class CateringTaxationService extends BaseService implements IService {

	private CateringTaxationDao dao;
	private CodeDao codeDao;
	
	/* (non-Javadoc)
	 * @see com.sxds.wn.service.BaseService#checkPermission()
	 */
	@Override
	protected boolean checkPermission() throws SecurityException {
		return false;
	}

	/**
	 * 获取
	 * @throws DataAccessException
	 */
	public void getCessLevel() throws DataAccessException {
		request.getRequestAttributes().put("fdzlDm", "02");
		request.getRequestAttributes().put("fdsxzlDm", "01");
		List cyrsSessLevelList = codeDao.getCessLevel(request.getRequestAttributes());
		request.getRequestAttributes().put("fdsxzlDm", "04");
		List fzfSessLevelList = codeDao.getCessLevel(request.getRequestAttributes());
		request.getRequestAttributes().put("fdsxzlDm", "05");
		List gxfySessLevelList = codeDao.getCessLevel(request.getRequestAttributes());
		request.getRequestAttributes().put("fdsxzlDm", "03");
		List jymjSessLevelList = codeDao.getCessLevel(request.getRequestAttributes());
		List hotleTypeList = codeDao.getHotelType(null);
		response.getPageAttributes().put("cyrsSessLevelList", cyrsSessLevelList);
		response.getPageAttributes().put("fzfSessLevelList", fzfSessLevelList);
		response.getPageAttributes().put("gxfySessLevelList", gxfySessLevelList);
		response.getPageAttributes().put("jymjSessLevelList", jymjSessLevelList);
		response.getPageAttributes().put("hotleTypeList", hotleTypeList);
		response.getPageAttributes().put("sysDate", DateUtil.getSystemDate());
		response.setOk(true);
	}
	
	/**
	 * 获取纳税人信息
	 * @throws DataAccessException
	 */
	public void getTaxPayerInfo() throws DataAccessException {
		String taxpayerId = this.request.getHttpRequest().getParameter("taxpayerId");
		TaxpayerInfoBo taxPayerInfo = dao.getTaxpayerInfo(taxpayerId);
		this.response.setOk(true);
		this.response.getPageAttributes().put("taxPayerInfo", taxPayerInfo);
	}
	
	public void insertCateringTaxation() throws DataAccessException {
		CateringTaxationBo bo = (CateringTaxationBo)this.parseRequest(CateringTaxationBo.class.getName());
		//设置其他信息
		bo.setGlDm(String.valueOf(user.getUserId()));
		bo.setLrry(user.getUserName());
		dao.insertCateringSetTax(bo);
		this.response.setOk(true);
		this.response.setResponseMessage("增加纳税申报表成功！");
	}

	/* (non-Javadoc)
	 * @see com.sxds.wn.service.BaseService#validateParameters()
	 */
	@Override
	protected boolean validateParameters() throws ParameterException {
		return false;
	}

	public void setDao(CateringTaxationDao dao) {
		this.dao = dao;
	}

	/**
	 * @param codeDao the codeDao to set
	 */
	public void setCodeDao(CodeDao codeDao) {
		this.codeDao = codeDao;
	}
	
	

}
